package org.jiuling.email.config;

import org.jiuling.email.Email;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 紫灵
 * @date 2022年08月11日 11时00分29秒
 */
@Configuration
public class EmailBeanConfig {

    @Bean
    @ConfigurationProperties(prefix = "jiu-ling.email")
    public EmailConfig emailConfig(){
        return new EmailConfig();
    }

    @Bean
    public Email email(){
        return new Email(emailConfig());
    }
}
